package com.csgc.camera.base

import androidx.viewbinding.ViewBinding


abstract class LazyFragment<T : ViewBinding> : BaseFragment<T>() {

    protected var isLoaded = false

    override fun onResume() {
        super.onResume()
        if (!isLoaded && !isHidden) {
            lazyInit()
            isLoaded = true
        }
    }

    override fun onDestroyView() {
        super.onDestroyView()
        isLoaded = false
    }

    abstract fun lazyInit()
}